package com.ihr360.payroll.test.mock;

import com.ihr360.expr.ExprArray;
import com.ihr360.expr.ExprDouble;
import com.ihr360.expr.ExprInteger;
import com.ihr360.expr.core.Expr;

/**
 * //[1-收入下限,2-收入上限,3-固定免税扣除额,4-免税扣除比例,5-应纳税所得额下限,6-应纳税所得额上限,7-税率,8-速算扣除数]
 */
public class TaxTableHelper {
    /**
     * 获取个人所得税税表
     * @return
     */
    public static ExprArray getSalaryTaxTable() {
        ExprArray taxTable = new ExprArray(8,5);
        taxTable.set(new Expr[]{
                new ExprDouble(0),new ExprDouble(0.0),new ExprInteger(0),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(3500.001),new ExprDouble(0.03),new ExprInteger(0),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(5000.001),new ExprDouble(0.10),new ExprInteger(105),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(8000.001),new ExprDouble(0.20),new ExprInteger(555),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(12500.001),new ExprDouble(0.25),new ExprInteger(1005),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(38500.001),new ExprDouble(0.30),new ExprInteger(2755),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(58500.001),new ExprDouble(0.35),new ExprInteger(55505),new ExprDouble(3500),new ExprDouble(0),
                new ExprDouble(83500.001),new ExprDouble(0.45),new ExprInteger(13505),new ExprDouble(3500),new ExprDouble(0),
        });
        return taxTable;
    }

    public static ExprArray getYearEndBonusTaxTable(){
        ExprArray taxTable = new ExprArray(8,5);
        taxTable.set(new Expr[]{
                new ExprDouble(0),new ExprDouble(0.03),new ExprInteger(0),new ExprDouble(0),new ExprDouble(0),
                new ExprDouble(1500),new ExprDouble(0.10),new ExprInteger(105),new ExprDouble(0),new ExprDouble(0),
                new ExprDouble(4500.001),new ExprDouble(0.20),new ExprInteger(555),new ExprDouble(0),new ExprDouble(0),
                new ExprDouble(9000.001),new ExprDouble(0.25),new ExprInteger(1005),new ExprDouble(0),new ExprDouble(0),
                new ExprDouble(35000.001),new ExprDouble(0.30),new ExprInteger(2755),new ExprDouble(0),new ExprDouble(0),
                new ExprDouble(55500.001),new ExprDouble(0.35),new ExprInteger(5505),new ExprDouble(0),new ExprDouble(0),
                new ExprDouble(80000.001),new ExprDouble(0.45),new ExprInteger(13505),new ExprDouble(0),new ExprDouble(0),
        });
        return taxTable;
    }
}